package com.chinasofti.fileServer;

import com.chinasofti.po.Fistday;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class GetFirstDay {
    public static List<Fistday> readData() throws IOException {
        List<Fistday> Fistdays=new ArrayList<>();
        BufferedReader rb=new BufferedReader(new FileReader("D:\\pxthadoop\\file\\firstday.txt"));
        String len=null;
        while((len=rb.readLine())!=null){

            Fistday fistday=new Fistday();
            String[]strs=len.split("\t");
            fistday.setHour(strs[0]);
            fistday.setTemper(strs[1]);
            Fistdays.add(fistday);
        }
        return Fistdays;
    }

    public static void main(String[] args) throws IOException {
        List<Fistday> Fistdays=GetFirstDay.readData();
        for (Fistday data:Fistdays){
            System.out.println(data);
        }
    }
}
